<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title><?php echo C('WEB_SITE_TITLE');?></title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <link href="__RES__/css/login.css" rel="stylesheet" type="text/css"/>
        <script src="__RES__/js/jquery-1.11.1.min.js" type="text/javascript"></script>
        
    </head>
    <body>
        <div class="Head">
            <div class="Links">
                <div style="float:right;">
                    <button type="button" class="Button" onclick="admin();">
                        访问后台
                    </button>
                </div>
            </div>
            <div class="logo">
               <img style="border:0 none;" src="__RES__/img/logo.gif"/>
            </div>
            <h3 style="float:right;margin-right: 40px; color:#333;">
                工程技术中心学习系统
            </h3>
        </div>

        <div class="Main">
            <div class="MainL">
                <div class="LTop">
                    
                </div>
                <div class="LContent"></div>
                <div class="LB"></div>
            </div>
            <div class="MainR">

                

                <h3 class="Header"></h3>

                <div id="logArea">
                    <div class="Error">
                        <div class="NoteError"></div>
                    </div>
                    <form id="loginForm" method="post" action="">
                        <table class="loginTable">

                            <tr>
                                <th>员工编号</th>
                                <td><input type="text" id="username" name="username" class="input" value="" /></td>
                                <td>

                                </td>
                            </tr>

                            <tr>
                                <th>密　码</th>
                                <td>
                                    <input type="password" id="password" name="password" class="input" autocomplete="off" value="" />
                                </td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="3" id="loginResult" style="color: red;">
                                    
                                </td>
                            </tr>

                            <tfoot>
                                <tr>
                                    <td></td>
                                    <td colspan="2" >
                                        <button id="btnLogin" type="button" class="Button">
                                            登　录
                                        </button>
                                        <button type="button" id="btnRegist" class="Button" onclick="location.href='<?php echo U(registPage);?>'">
                                            注  册 
                                        </button>

                                        <a href="#" onclick="forgetPwd();">
                                            忘记密码？
                                        </a>

                                    </td>
                                </tr>
                                <tr>
                                    <td colspan='3'>
                                        
                                    </td>
                                </tr>
                            </tfoot>
                            
                        </table>
                    </form>

                </div>

                
            </div>

            <div class="footer">
                <div class="footerBg">
                    <div class="copyright">
                         Copyright &copy; 2014  长虹-工程技术中心
                    </div>
                </div>
            </div>
        </div>

        
    <script>
        function forgetPwd(){
            
            var username = $.trim($("#username").val());
            
            if( username === ""){
                alert("请先输入用户名！");
                $("#username").focus();
                return;
            }
            
            var sendData = {
                "username" : username
            };
            
            $.post("<?php echo U(forgetPwd);?>", sendData).done(function(responseData){
                if (responseData.status === 1) {
                        alert(responseData.info);
                        location.href = responseData.jumpUrl;
                    } else {
                        alert(responseData.info);
                    }
            });
            
        }
    </script>
    
    <script>
        $(function(){
           
           $("#btnLogin").click(function(){
               //alert("333");
               
               var username = $.trim($("#username").val());
               var password = $.trim($("#password").val());
               
                if( username === "" || password === ""){
                    alert("请先输入用户名或密码！");
                    return;
                }
               
               var sendData = {
                   "username" : username,
                   "password" : password
               };
               
               $.post("<?php echo U(runLogin);?>", sendData).done(function(responseData){
                   if(responseData.status === 1){
                        $("#loginResult").text(responseData.info);
                        location.href = responseData.jumpUrl;
                    }else{
                        $("#loginResult").text(responseData.info);
                    }
               });
           });
           
        });
    </script>

        
        <script>
            function admin(){
                location.href = "<?php echo U('Admin/Login/index');?>";
            }
        </script>
    </body>
</html>